#ifndef WIDGETS_H_
#define WIDGETS_H_

#include "gui.h"

GtkWidget 		*mainWindow;
GtkStatusbar 	*mainStatusBar;
GtkWidget 		*mainStatusLabel;
GtkTreeView		*userView;

GtkWidget 		*chatWindow;
GtkTextView		*incomingText;
GtkTextView		*outgoingText;

GladeXML 		*xml;

GtkListStore  	*userStore;
GtkTreeIter   	 userIter;

enum
{
  COL_NAME = 0,
  COL_SERVICE,
  COL_IP,
  NUM_COLS
};

typedef struct {
	gchar * user;
	gchar * ip;
} user_ip_t;

void init_widgets();
void add_user(gchar * name, gchar * service, gchar * ip);
void remove_user(gchar * service);
gboolean remove_foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data);
GtkTreeModel * create_and_fill_model (void);
GtkWidget * create_view_and_model (GtkWidget *view);
gboolean get_user_from_ip_foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data);
void add_message(gchar * message, gchar * user);
gchar * get_user_from_ip(gchar * ip);

#endif /*WIDGETS_H_*/
